/**
 * Created by yuliang on 2015/5/12.
 */
// function hint(msg, duration) {
//     duration = isNaN(duration) ? 3000 : duration;
//     var m = document.createElement('div');
//     m.innerHTML = msg;
//     m.style.cssText = "width:60%; min-width:150px; background:black; opacity:0.5; height:40px; color:#fff; line-height:40px; text-align:center; border-radius:5px; position:fixed; top:90%; left:20%; z-index:99999999; font-weight:bold;";
//     document.body.appendChild(m);
//     setTimeout(function () {
//         var d = 0.5;
//         m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
//         m.style.opacity = '0';
//         setTimeout(function () {
//             document.body.removeChild(m)
//         }, d * 1000);
//     }, duration);
// }
//
//
// var _st = window.setTimeout;
// //fRef 是test函数,mDelay是时间
// window.setTimeout = function (fRef, mDelay) {
//     if (typeof fRef == 'function') {
//         var argu = Array.prototype.slice.call(arguments, 2);
//         var f = (
//             function () {
//                 fRef.apply(null, argu);
//             });
//         return _st(f, mDelay);
//     }
//     return _st(fRef, mDelay);
// }
//
// var bcNotify;
// if (bcNotify == null) {
//     bcNotify = {};
// }
/**
 * 提示 消息
 * @param type success  info  warning danger
 * @param msg  自定义消息
 * @param duration  超时关闭时间
 */
var hint = function (msg, duration, type) {
    if (type == null) {
        type = "success";
    }
    if (msg == null) {
        msg = "执行中";
    }
    duration = isNaN(duration) ? 2000 : duration;

    $.notify({message: msg}, {
        type: type,
        newest_on_top: true,
        delay: duration,
        timer:300,
        offset: {
            y: 2
        },
        placement: {
            from: "top",
            align: "center"
        }
    });
}